XT_YYYYMMDD_TIME
} xcsv_token;
+// Static definition of in_word_set to meet C99 rules as used by Clang.
+static struct xt_mapping *
+in_word_set (register const char *str, register unsigned int len);
+
#include "xcsv_tokens.gperf"
/****************************************************************************/
*/
xcsv_file.type = ff_type_file;
- xcsv_file.mkshort_handle = (struct short_handle_*) mkshort_new_handle();
+ xcsv_file.mkshort_handle = (struct short_handle *) mkshort_new_handle();
xcsv_file.gps_datum = GPS_DATUM_WGS84;
}
case gt_benchmark: return 0;
case gt_ape: return 0;
case gt_mega: return 0;
+ case gt_wherigo: return 0;
}
return 0;
49 degrees 34.7687 minutes
*/
+// The argument is marked 'volatile' because of an issue in Apple's v1.5 clang.
+// Without this, the sign of 'x' mysteriously changes while in the function.
+// adding a printf inside branches not taken changes the behaviour. Very
+// mysterious, but not worth tracking down at this time. When xcode 4 comes
+// along (or anyone really cares about mega performance of this fairly obscure
+// target, we should revisit this.
double
-deg_min_to_deg(gbuint32 x)
+deg_min_to_deg(volatile gbuint32 x)
{
double sign;
- gbuint32 sep;
- gbuint32 d;
- gbuint32 m10000;
-
+ gbuint32 sep;
+ gbuint32 d;
+ gbuint32 m10000;
// determine the sign
- if (x > 0x80000000) {
+ if (x > 0x80000000) {
sign = -1.0;
x -= 0x80000000;
- }
- else {
+ } else {
sign = 1.0;
}
sep = 1000000;
- // extract degrees
- d = x / sep;
-
- // extract (minutes * 10000)
+ // extract degrees
+ d = (unsigned int) x / (unsigned int) sep;
+ // extract (minutes * 10000)
m10000 = x - d * sep;
// convert minutes and degrees to a double
- return sign * ((double)d + ((double)m10000) / 600000.0);
+ return sign * ((double)d + ((double)m10000) / 600000.0);
}
/*
import_data_record(itracku_data_record* d)
{
int result = 0;
+
if (!itracku_is_valid_data_record(d)) {
result = 0;
}
io_cf_plugin_ref_t *plugInInterface = NULL;
usb_device_t **device;
io_service_t usbDevice;
- long result, score;
+ long result;
+ SInt32 score;
if (!IOIteratorIsValid (deviceIterator) || !(usbDevice = IOIteratorNext(deviceIterator)))
return NULL;
IOUSBFindInterfaceRequest request;
struct darwin_dev_handle *device;
- long score;
+ SInt32 score;
int current_interface;
device = dev->impl_info;
result = (*(device))->GetDeviceAddress(device, (USBDeviceAddress *)&address);
if (usb_debug >= 2)
- fprintf(stderr, "usb_os_find_devices: Found USB device at location 0x%08lx\n", location);
+ fprintf(stderr, "usb_os_find_devices: Found USB device at location 0x%08x\n", location);
/* first byte of location appears to be associated with the device's bus */
if (location >> 24 == bus_loc >> 24) {
LIST_ADD(fdev, dev);
if (usb_debug >= 2)
- fprintf(stderr, "usb_os_find_devices: Found %s on %s at location 0x%08lx\n",
+ fprintf(stderr, "usb_os_find_devices: Found %s on %s at location 0x%08x\n",
dev->filename, bus->dirname, location);
}
# define DBG(args) dbgprintf args
#else
-# define DBG(args) ;
+# define DBG(args) do {} while (0) ;
#endif
static char *
}
}
- mkshort_handle = (struct short_handle_*) mkshort_new_handle();
+ mkshort_handle = (struct short_handle*) mkshort_new_handle();
setshort_length(mkshort_handle, atoi(snlenopt));
if (opt_gisteq) {
else if (0 == case_ignore_strcmp(avp[0], "Altitude"))
wpt_tmp->altitude = atof(avp[1]);
else if (0 == case_ignore_strcmp(avp[0], "TimeStamp"))
- /* nothing for the moment */;
+ { /* nothing for the moment */ }
avp+=2;
}
-/* ANSI-C code produced by gperf version 3.0.1 */
+/* ANSI-C code produced by gperf version 3.0.3 */
/* Command-line: gperf -L ANSI-C -D -t xcsv_tokens.in */
/* Computed positions: -k'2,4-5,12,$' */
#ifdef __GNUC__
__inline
+#ifdef __GNUC_STDC_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
#endif
struct xt_mapping *
in_word_set (register const char *str, register unsigned int len)